/* 滥用内存
 * 功能: 向已分配内存以外的内存写数据
 * 结果: 程序运行会被系统停止*/
#include <stdlib.h>

#define ONE_K (1024)

int main()
{
    char *some_memory;
    char *scan_ptr;

    some_memory = (char *)malloc(ONE_K);
    if(some_memory == NULL) exit(EXIT_FAILURE);

    scan_ptr = some_memory;
    while(1){
        *scan_ptr = '\0';
        scan_ptr++;
    }

    exit(EXIT_SUCCESS);
}
